level bar: Make the full offset official
authorMatthias Clasen <mclasen@redhat.com>
Sat, 6 Feb 2016 15:11:17 +0000 (16:11 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 6 Feb 2016 15:11:17 +0000 (16:11 +0100)
We are adding 3 offsets, not just two. Add a define for the
third one, and mention it in the docs.

docs/reference/gtk/gtk3-sections.txt
gtk/gtklevelbar.c
gtk/gtklevelbar.h

index fd7c85ab41ee501bca4f67dd1752cad98f979bbc..d8688da01abf9ebdbd554cd22cd42f3ef16a87f4 100644 (file)
@@ -3541,6 +3541,7 @@ gtk_status_icon_get_type
 <TITLE>GtkLevelBar</TITLE>
 GTK_LEVEL_BAR_OFFSET_LOW
 GTK_LEVEL_BAR_OFFSET_HIGH
+GTK_LEVEL_BAR_OFFSET_FULL
 GtkLevelBarMode
 GtkLevelBar
 gtk_level_bar_new
index 7b50585da53251f9a9495371a4bfb5e2a70e9dd6..5661e0269f2c61a05b5bdf577c85ec8e7a7b7769 100644 (file)
  *
  * Use gtk_level_bar_set_value() to set the current value, and
  * gtk_level_bar_add_offset_value() to set the value offsets at which
- * the bar will be considered in a different state. GTK will add two offsets
- * by default on the level bar: #GTK_LEVEL_BAR_OFFSET_LOW and
- * #GTK_LEVEL_BAR_OFFSET_HIGH, with values 0.25 and 0.75 respectively.
+ * the bar will be considered in a different state. GTK will add a few
+ * offsets by default on the level bar: #GTK_LEVEL_BAR_OFFSET_LOW,
+ * #GTK_LEVEL_BAR_OFFSET_HIGH and #GTK_LEVEL_BAR_OFFSET_FULL, with
+ * values 0.25, 0.75 and 1.0 respectively.
  *
  * ## Adding a custom offset on the bar
  *
@@ -1146,7 +1147,7 @@ gtk_level_bar_init (GtkLevelBar *self)
 
   gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_LOW, 0.25);
   gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_HIGH, 0.75);
-  gtk_level_bar_ensure_offset (self, "full", 1.0);
+  gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_FULL, 1.0);
 
   priv->block_gadget = NULL;
   priv->n_blocks = 0;
index aab7064fa69b572a75e18251a3d1516e6e0fc61d..77c1693b7bb1f10a24949f89fdd7328cd2efff41 100644 (file)
@@ -54,6 +54,15 @@ G_BEGIN_DECLS
  */
 #define GTK_LEVEL_BAR_OFFSET_HIGH "high"
 
+/**
+ * GTK_LEVEL_BAR_OFFSET_FULL:
+ *
+ * The name used for the stock full offset included by #GtkLevelBar.
+ *
+ * Since: 3.20
+ */
+#define GTK_LEVEL_BAR_OFFSET_FULL "full"
+
 typedef struct _GtkLevelBarClass   GtkLevelBarClass;
 typedef struct _GtkLevelBar        GtkLevelBar;
 typedef struct _GtkLevelBarPrivate GtkLevelBarPrivate;